Class: Gitara::Voice
- Inherits:
-
Valuable
- Object
- Valuable
- Gitara::Voice
- Defined in:
- lib/gitara/voice.rb
Instance Attribute Summary collapse
Instance Method Summary collapse
- #call_name ⇒ Object
- #definition_name ⇒ Object
- #id ⇒ Object
- #id_as_word ⇒ Object
- #octave ⇒ Object
- #parent ⇒ Object
- #stem_type ⇒ Object
- #transposition ⇒ Object
Instance Attribute Details
#$1($1) ⇒ Object
5 |
# File 'lib/gitara/voice.rb', line 5 has_value :id |
Instance Method Details
#call_name ⇒ Object
8 9 10 |
# File 'lib/gitara/voice.rb', line 8 def call_name "\\#{definition_name}" end |
#definition_name ⇒ Object
12 13 14 |
# File 'lib/gitara/voice.rb', line 12 def definition_name "v#{id_as_word}" end |
#id ⇒ Object
5 |
# File 'lib/gitara/voice.rb', line 5 has_value :id |
#id_as_word ⇒ Object
16 17 18 |
# File 'lib/gitara/voice.rb', line 16 def id_as_word Utilities.id_as_word(id) end |
#octave ⇒ Object
20 21 22 |
# File 'lib/gitara/voice.rb', line 20 def octave (self.parent.max_number_of_voices - self.id) + 1 end |
#parent ⇒ Object
6 |
# File 'lib/gitara/voice.rb', line 6 has_value :parent |
#stem_type ⇒ Object
24 25 26 |
# File 'lib/gitara/voice.rb', line 24 def stem_type "\\voice#{id_as_word}" end |
#transposition ⇒ Object
28 29 30 |
# File 'lib/gitara/voice.rb', line 28 def transposition "#{self.parent.transposition}#{"'" * self.octave}" if self.parent.transposition end |